package dubboTest;

import com.nbb.itf.ArticleService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by yuqi on 2017/5/10.
 */
public class DubboConsumer {


    public static void main(String args[]){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("/dubbo-consumer.xml");
        context.start();
        ArticleService articleService = (ArticleService)context.getBean("articleService"); // 获取远程服务代理
        String name = articleService.getArticleNameById(1L);// 执行远程方法
        System.out.println(name);
    }
}
